//
//  SickHeaderTableView.m
//  QuickCure1
//
//  Created by JianFeng on 16/11/4.
//  Copyright © 2016年 maoge. All rights reserved.
//
#import "PresonMondel.h"
#import "SickHeaderTableCell.h"
#import "SickHeaderTableView.h"
@interface SickHeaderTableView()<UITableViewDataSource,UITableViewDelegate>
@end
static NSString *cellID = @"ZFBCell";
@implementation SickHeaderTableView
#pragma mark - 初始化
- (instancetype)initWithFrame:(CGRect)frame style:(UITableViewStyle)style
{
    self = [super initWithFrame:frame style:style];
    if (self) {
        [self setupUI];
    }
    return self;
}
#pragma mark - 创建控件
-(void)setupUI{
    self.delegate = self;
    self.dataSource = self;
    UINib *nib = [UINib nibWithNibName:@"SickHeaderTableCell" bundle:nil];
    [self registerNib:nib forCellReuseIdentifier:cellID];
    self.rowHeight = 215;
}
#pragma mark - <UITableViewDataSource,UITableViewDelegate>

-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    if (!self.modelArray) {
        return 1;
    }
    return self.modelArray.count;
}
-(UITableViewCell*)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    SickHeaderTableCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID forIndexPath:indexPath];
    if (self.modelArray) {
        PresonMondel *model = self.modelArray[indexPath.row];
        cell.model = model;
      }
    
    //设置分割线
    UIImageView *separatView = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"table_item_bk_with_top_gray_corner"]];
    [cell.contentView addSubview:separatView];
    
    [separatView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.leading.trailing.bottom.equalTo(cell.contentView);
        make.height.mas_equalTo(5);
    }];
    
    
    return cell;
}

@end
